/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('avatar', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model CancelVideoTaskRequest {
  app?: {
    appId?: string(name='AppId', example='12131231'),
  }(name='App'),
  taskUuid?: string(name='TaskUuid', example='xxxx-xxxx-xxxx'),
  tenantId?: long(name='TenantId', example='xxxxx'),
}

model CancelVideoTaskShrinkRequest {
  appShrink?: string(name='App'),
  taskUuid?: string(name='TaskUuid', example='xxxx-xxxx-xxxx'),
  tenantId?: long(name='TenantId', example='xxxxx'),
}

model CancelVideoTaskResponseBody = {
  code?: string(name='Code', example='502'),
  data?: {
    failReason?: string(name='FailReason'),
    isCancel?: boolean(name='IsCancel', example='true'),
    taskUuid?: string(name='TaskUuid', example='xxxx-xxxx-xxxx'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='xxxx-xxxx-xxxx'),
  success?: boolean(name='Success', example='true'),
}

model CancelVideoTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CancelVideoTaskResponseBody(name='body'),
}

async function cancelVideoTaskWithOptions(tmpReq: CancelVideoTaskRequest, runtime: Util.RuntimeOptions): CancelVideoTaskResponse {
  Util.validateModel(tmpReq);
  var request = new CancelVideoTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appShrink)) {
    query['App'] = request.appShrink;
  }
  if (!Util.isUnset(request.taskUuid)) {
    query['TaskUuid'] = request.taskUuid;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CancelVideoTask',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function cancelVideoTask(request: CancelVideoTaskRequest): CancelVideoTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelVideoTaskWithOptions(request, runtime);
}

model ClientAuthRequest {
  appId?: string(name='AppId', example='dsdsf1'),
  deviceId?: string(name='DeviceId', example='xxxxxx'),
  deviceInfo?: string(name='DeviceInfo', example='{"xxxx":"xxxxxxxxxxx"}'),
  deviceType?: string(name='DeviceType', example='largeScreen'),
  license?: string(name='License', example='FqTyXFrIqbIGnb_oqIvszv1wffODnpCDNDvOc6xNXbAhak1AwsfrCo2cSrPFAhHEitOb9VEG'),
  tenantId?: long(name='TenantId', example='9185'),
}

model ClientAuthResponseBody = {
  code?: string(name='Code', example='10010001'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='true'),
}

model ClientAuthResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ClientAuthResponseBody(name='body'),
}

async function clientAuthWithOptions(request: ClientAuthRequest, runtime: Util.RuntimeOptions): ClientAuthResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!Util.isUnset(request.deviceInfo)) {
    query['DeviceInfo'] = request.deviceInfo;
  }
  if (!Util.isUnset(request.deviceType)) {
    query['DeviceType'] = request.deviceType;
  }
  if (!Util.isUnset(request.license)) {
    query['License'] = request.license;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ClientAuth',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function clientAuth(request: ClientAuthRequest): ClientAuthResponse {
  var runtime = new Util.RuntimeOptions{};
  return clientAuthWithOptions(request, runtime);
}

model ClientStartRequest {
  appId?: string(name='AppId', example='dsdsf1'),
  tenantId?: long(name='TenantId', example='9185'),
}

model ClientStartResponseBody = {
  code?: string(name='Code', example='10010002'),
  data?: {
    imToken?: string(name='ImToken', example='xxxxxxxxxx'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4C8BF3A5-948F-1F89-AACD-D18DEF52D1XX'),
  success?: boolean(name='Success', example='true'),
}

model ClientStartResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ClientStartResponseBody(name='body'),
}

async function clientStartWithOptions(request: ClientStartRequest, runtime: Util.RuntimeOptions): ClientStartResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ClientStart',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function clientStart(request: ClientStartRequest): ClientStartResponse {
  var runtime = new Util.RuntimeOptions{};
  return clientStartWithOptions(request, runtime);
}

model ClientUnbindDeviceRequest {
  deviceId?: string(name='DeviceId', example='dsdsf1'),
  tenantId?: long(name='TenantId', example='9185'),
}

model ClientUnbindDeviceResponseBody = {
  code?: string(name='Code', example='10010001'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='true'),
}

model ClientUnbindDeviceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ClientUnbindDeviceResponseBody(name='body'),
}

async function clientUnbindDeviceWithOptions(request: ClientUnbindDeviceRequest, runtime: Util.RuntimeOptions): ClientUnbindDeviceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.deviceId)) {
    query['DeviceId'] = request.deviceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ClientUnbindDevice',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function clientUnbindDevice(request: ClientUnbindDeviceRequest): ClientUnbindDeviceResponse {
  var runtime = new Util.RuntimeOptions{};
  return clientUnbindDeviceWithOptions(request, runtime);
}

model CloseTimedResetOperateRequest {
  instanceId?: string(name='InstanceId', example='avatar_operation_public_cn-7pp2****802'),
  tenantId?: long(name='TenantId', example='xxxxx'),
}

model CloseTimedResetOperateResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    instanceId?: string(name='InstanceId', example='avatar_operation_public_cn-7pp2****802'),
    tenantId?: long(name='TenantId', example='xxxxx'),
  }(name='Data'),
  message?: string(name='Message', example='operation success.'),
  requestId?: string(name='RequestId', description='Id of the request', example='4C8BF3A5-948F-1F89-AACD-D18DEF52D1XX'),
  success?: boolean(name='Success', example='true'),
}

model CloseTimedResetOperateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CloseTimedResetOperateResponseBody(name='body'),
}

async function closeTimedResetOperateWithOptions(request: CloseTimedResetOperateRequest, runtime: Util.RuntimeOptions): CloseTimedResetOperateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CloseTimedResetOperate',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function closeTimedResetOperate(request: CloseTimedResetOperateRequest): CloseTimedResetOperateResponse {
  var runtime = new Util.RuntimeOptions{};
  return closeTimedResetOperateWithOptions(request, runtime);
}

model ConfirmAvatar2dTrainRequest {
  code?: string(name='Code', example='CH_2d_xxxxxx'),
  confirm?: string(name='Confirm', example='ACCEPT'),
  tenantId?: long(name='TenantId', example='xxxxx'),
}

model ConfirmAvatar2dTrainResponseBody = {
  code?: string(name='Code', example='10010001'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='false'),
}

model ConfirmAvatar2dTrainResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ConfirmAvatar2dTrainResponseBody(name='body'),
}

async function confirmAvatar2dTrainWithOptions(request: ConfirmAvatar2dTrainRequest, runtime: Util.RuntimeOptions): ConfirmAvatar2dTrainResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.code)) {
    query['Code'] = request.code;
  }
  if (!Util.isUnset(request.confirm)) {
    query['Confirm'] = request.confirm;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ConfirmAvatar2dTrain',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function confirmAvatar2dTrain(request: ConfirmAvatar2dTrainRequest): ConfirmAvatar2dTrainResponse {
  var runtime = new Util.RuntimeOptions{};
  return confirmAvatar2dTrainWithOptions(request, runtime);
}

model Create2dAvatarRequest {
  callback?: boolean(name='Callback', example='false'),
  description?: string(name='Description'),
  image?: string(name='Image', example='https://virtual-human-assets.oss-cn-beijing.aliyuncs.com/2d_assets/xxx/xxx/xxx.png?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx'),
  name?: string(name='Name'),
  orientation?: int32(name='Orientation', example='1'),
  portrait?: string(name='Portrait', example='https://virtual-human-assets.oss-cn-beijing.aliyuncs.com/2d_assets/xxx/xxx/xxx.png?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx'),
  tenantId?: long(name='TenantId', example='9185'),
  transparent?: boolean(name='Transparent', example='true'),
  video?: string(name='Video', example='https://virtual-human-assets.oss-cn-beijing.aliyuncs.com/2d_assets/xxx/xxx/xxx.mov?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx'),
}

model Create2dAvatarResponseBody = {
  code?: string(name='Code', example='10010001'),
  data?: {
    code?: string(name='Code', example='CH_2d_xxxxxx'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='0A466686-8F3A-55A6-93D8-A0225DC965C0'),
  success?: boolean(name='Success', example='false'),
}

model Create2dAvatarResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Create2dAvatarResponseBody(name='body'),
}

async function create2dAvatarWithOptions(request: Create2dAvatarRequest, runtime: Util.RuntimeOptions): Create2dAvatarResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callback)) {
    query['Callback'] = request.callback;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.image)) {
    query['Image'] = request.image;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.orientation)) {
    query['Orientation'] = request.orientation;
  }
  if (!Util.isUnset(request.portrait)) {
    query['Portrait'] = request.portrait;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.transparent)) {
    query['Transparent'] = request.transparent;
  }
  if (!Util.isUnset(request.video)) {
    query['Video'] = request.video;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Create2dAvatar',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function create2dAvatar(request: Create2dAvatarRequest): Create2dAvatarResponse {
  var runtime = new Util.RuntimeOptions{};
  return create2dAvatarWithOptions(request, runtime);
}

model DeleteAvatarRequest {
  code?: string(name='Code', example='CH_2d_xxxxxx'),
  tenantId?: long(name='TenantId', example='9185'),
}

model DeleteAvatarResponseBody = {
  code?: string(name='Code', example='10050008'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='false'),
}

model DeleteAvatarResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteAvatarResponseBody(name='body'),
}

async function deleteAvatarWithOptions(request: DeleteAvatarRequest, runtime: Util.RuntimeOptions): DeleteAvatarResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.code)) {
    query['Code'] = request.code;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteAvatar',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteAvatar(request: DeleteAvatarRequest): DeleteAvatarResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAvatarWithOptions(request, runtime);
}

model DuplexDecisionRequest {
  appId?: string(name='AppId', example='12131231'),
  bizRequestId?: string(name='BizRequestId', example='xxxxxxxxxx'),
  callTime?: int32(name='CallTime', example='1'),
  customKeywords?: [ string ](name='CustomKeywords'),
  dialogContext?: {
    curUtteranceIdx?: int32(name='CurUtteranceIdx', example='1'),
    histories?: [ 
      {
        robot?: string(name='Robot'),
        user?: string(name='User'),
      }
    ](name='Histories'),
  }(name='DialogContext'),
  dialogStatus?: string(name='DialogStatus', example='ROBOTTALK'),
  interruptType?: int32(name='InterruptType', example='1'),
  sessionId?: string(name='SessionId', example='xxxxxxxxxx'),
  tenantId?: long(name='TenantId', example='xxxxx'),
  text?: string(name='Text'),
}

model DuplexDecisionShrinkRequest {
  appId?: string(name='AppId', example='12131231'),
  bizRequestId?: string(name='BizRequestId', example='xxxxxxxxxx'),
  callTime?: int32(name='CallTime', example='1'),
  customKeywordsShrink?: string(name='CustomKeywords'),
  dialogContextShrink?: string(name='DialogContext'),
  dialogStatus?: string(name='DialogStatus', example='ROBOTTALK'),
  interruptType?: int32(name='InterruptType', example='1'),
  sessionId?: string(name='SessionId', example='xxxxxxxxxx'),
  tenantId?: long(name='TenantId', example='xxxxx'),
  text?: string(name='Text'),
}

model DuplexDecisionResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    actionType?: string(name='ActionType', example='UNDERTAKE'),
    grabType?: string(name='GrabType', example='GRAB'),
    outputText?: string(name='OutputText'),
  }(name='Data'),
  message?: string(name='Message', example='success'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: string(name='Success', example='true'),
}

model DuplexDecisionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DuplexDecisionResponseBody(name='body'),
}

async function duplexDecisionWithOptions(tmpReq: DuplexDecisionRequest, runtime: Util.RuntimeOptions): DuplexDecisionResponse {
  Util.validateModel(tmpReq);
  var request = new DuplexDecisionShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.customKeywords)) {
    request.customKeywordsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.customKeywords, 'CustomKeywords', 'json');
  }
  if (!Util.isUnset(tmpReq.dialogContext)) {
    request.dialogContextShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.dialogContext, 'DialogContext', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.bizRequestId)) {
    query['BizRequestId'] = request.bizRequestId;
  }
  if (!Util.isUnset(request.callTime)) {
    query['CallTime'] = request.callTime;
  }
  if (!Util.isUnset(request.customKeywordsShrink)) {
    query['CustomKeywords'] = request.customKeywordsShrink;
  }
  if (!Util.isUnset(request.dialogContextShrink)) {
    query['DialogContext'] = request.dialogContextShrink;
  }
  if (!Util.isUnset(request.dialogStatus)) {
    query['DialogStatus'] = request.dialogStatus;
  }
  if (!Util.isUnset(request.interruptType)) {
    query['InterruptType'] = request.interruptType;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.text)) {
    query['Text'] = request.text;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DuplexDecision',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function duplexDecision(request: DuplexDecisionRequest): DuplexDecisionResponse {
  var runtime = new Util.RuntimeOptions{};
  return duplexDecisionWithOptions(request, runtime);
}

model GetVideoTaskInfoRequest {
  app?: {
    appId?: string(name='AppId', example='12131231'),
  }(name='App'),
  taskUuid?: string(name='TaskUuid', example='xxxx-xxxx-xxx'),
  tenantId?: long(name='TenantId', example='xxxxxx'),
}

model GetVideoTaskInfoShrinkRequest {
  appShrink?: string(name='App'),
  taskUuid?: string(name='TaskUuid', example='xxxx-xxxx-xxx'),
  tenantId?: long(name='TenantId', example='xxxxxx'),
}

model GetVideoTaskInfoResponseBody = {
  code?: string(name='Code', example='502'),
  data?: {
    process?: string(name='Process', example='99'),
    status?: string(name='Status', example='1'),
    taskResult?: {
      alphaUrl?: string(name='AlphaUrl'),
      attachmentUrl?: string(name='AttachmentUrl'),
      failCode?: string(name='FailCode', example='20002'),
      failReason?: string(name='FailReason'),
      previewPic?: string(name='PreviewPic'),
      subtitlesUrl?: string(name='SubtitlesUrl', example='xxx/xxx/xxx.ass'),
      videoDuration?: int32(name='VideoDuration'),
      videoUrl?: string(name='VideoUrl', example='xxx/xxxx/xx.mp4'),
      wordSubtitlesUrl?: string(name='WordSubtitlesUrl', description='字粒度的时间戳文件，特定任务支持', example='xxx/xxx/xxx.ass'),
    }(name='TaskResult'),
    taskUuid?: string(name='TaskUuid', example='xxxx-xxx-xx-xx'),
    type?: string(name='Type', example='1'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='xxx-xxx-xxx-xx'),
  success?: boolean(name='Success', example='true'),
}

model GetVideoTaskInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetVideoTaskInfoResponseBody(name='body'),
}

async function getVideoTaskInfoWithOptions(tmpReq: GetVideoTaskInfoRequest, runtime: Util.RuntimeOptions): GetVideoTaskInfoResponse {
  Util.validateModel(tmpReq);
  var request = new GetVideoTaskInfoShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetVideoTaskInfo',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getVideoTaskInfo(request: GetVideoTaskInfoRequest): GetVideoTaskInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return getVideoTaskInfoWithOptions(request, runtime);
}

model LicenseAuthRequest {
  appId?: string(name='AppId', example='dsdsf1'),
  license?: string(name='License', example='FqTyXFrIqbIGnb_oqIvszv1wffODnpCDNDvOc6xNXbAhak1AwsfrCo2cSrPFAhHEitOb9VEG'),
  tenantId?: long(name='TenantId', example='9185'),
}

model LicenseAuthResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    token?: string(name='Token', example='vHOgG+IbVrm0QXTzVB/O4GJJLEAWr67gl7NGWowHjioMKIh2yc9PNu21S7t8mjuVo3Z'),
  }(name='Data'),
  message?: string(name='Message', example='operation success.'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='true'),
}

model LicenseAuthResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: LicenseAuthResponseBody(name='body'),
}

async function licenseAuthWithOptions(request: LicenseAuthRequest, runtime: Util.RuntimeOptions): LicenseAuthResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.license)) {
    query['License'] = request.license;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'LicenseAuth',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function licenseAuth(request: LicenseAuthRequest): LicenseAuthResponse {
  var runtime = new Util.RuntimeOptions{};
  return licenseAuthWithOptions(request, runtime);
}

model QueryAvatarRequest {
  code?: string(name='Code', example='CH_2d_xxxxxx'),
  tenantId?: long(name='TenantId', example='9185'),
}

model QueryAvatarResponseBody = {
  code?: string(name='Code', example='10050008'),
  data?: {
    allLocateImages?: map[string]any(name='AllLocateImages'),
    avatarType?: string(name='AvatarType', example='0'),
    description?: string(name='Description'),
    image?: string(name='Image', example='https://virtual-human-assets.oss-cn-beijing.aliyuncs.com/2d_assets/xxx/xxx/xxx.png?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx'),
    makeFailReason?: string(name='MakeFailReason'),
    makeStage?: string(name='MakeStage'),
    makeStatus?: string(name='MakeStatus'),
    modelType?: string(name='ModelType', example='2d'),
    name?: string(name='Name'),
    portrait?: string(name='Portrait', example='https://virtual-human-assets.oss-cn-beijing.aliyuncs.com/2d_assets/xxx/xxx/xxx.png?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx'),
    preview?: string(name='Preview'),
    supportedResolutions?: {
      offline?: [ 
        {
          desc?: string(name='Desc'),
          height?: int32(name='Height', example='1920'),
          width?: int32(name='Width', example='1080'),
        }
      ](name='Offline'),
      online?: [ 
        {
          desc?: string(name='Desc'),
          height?: int32(name='Height', example='1920'),
          width?: int32(name='Width', example='1080'),
        }
      ](name='Online'),
    }(name='SupportedResolutions'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4C8BF3A5-948F-1F89-AACD-D18DEF52D1XX'),
  success?: boolean(name='Success', example='true'),
}

model QueryAvatarResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAvatarResponseBody(name='body'),
}

async function queryAvatarWithOptions(request: QueryAvatarRequest, runtime: Util.RuntimeOptions): QueryAvatarResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.code)) {
    query['Code'] = request.code;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAvatar',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAvatar(request: QueryAvatarRequest): QueryAvatarResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAvatarWithOptions(request, runtime);
}

model QueryAvatarListRequest {
  modelType?: string(name='ModelType', example='2d'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  tenantId?: long(name='TenantId', example='9185'),
}

model QueryAvatarListResponseBody = {
  code?: string(name='Code', example='10050008'),
  data?: {
    list?: [ 
      {
        avatarType?: string(name='AvatarType', example='0'),
        code?: string(name='Code', example='CH_2d_37AsLhUrBxacjHP0'),
        description?: string(name='Description'),
        image?: string(name='Image', example='https://virtual-human-assets.oss-cn-beijing.aliyuncs.com/2d_assets/xxx/xxx/xxx.png?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx'),
        makeFailReason?: string(name='MakeFailReason'),
        makeStage?: string(name='MakeStage'),
        makeStatus?: string(name='MakeStatus'),
        modelType?: string(name='ModelType', example='2d'),
        name?: string(name='Name'),
        portrait?: string(name='Portrait', example='https://virtual-human-assets.oss-cn-beijing.aliyuncs.com/2d_assets/xxx/xxx/xxx.png?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx'),
        preview?: string(name='Preview'),
        supportedResolutions?: {
          offline?: [ 
            {
              desc?: string(name='Desc'),
              height?: int32(name='Height', example='1920'),
              width?: int32(name='Width', example='1080'),
            }
          ](name='Offline'),
          online?: [ 
            {
              desc?: string(name='Desc'),
              height?: int32(name='Height', example='1920'),
              width?: int32(name='Width', example='1080'),
            }
          ](name='Online'),
        }(name='SupportedResolutions'),
      }
    ](name='List'),
    pageNo?: int32(name='PageNo', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: int32(name='TotalCount', example='4'),
    totalPage?: int32(name='TotalPage', example='1'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='true'),
}

model QueryAvatarListResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryAvatarListResponseBody(name='body'),
}

async function queryAvatarListWithOptions(request: QueryAvatarListRequest, runtime: Util.RuntimeOptions): QueryAvatarListResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.modelType)) {
    query['ModelType'] = request.modelType;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryAvatarList',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryAvatarList(request: QueryAvatarListRequest): QueryAvatarListResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryAvatarListWithOptions(request, runtime);
}

model QueryRunningInstanceRequest {
  app?: {
    appId?: string(name='AppId', example='ALIPUB5748B17121450'),
  }(name='App'),
  sessionId?: string(name='SessionId', example='76898bd3b90b4a65b1c078d8824a2e9c'),
  tenantId?: long(name='TenantId', example='9185'),
}

model QueryRunningInstanceShrinkRequest {
  appShrink?: string(name='App'),
  sessionId?: string(name='SessionId', example='76898bd3b90b4a65b1c078d8824a2e9c'),
  tenantId?: long(name='TenantId', example='9185'),
}

model QueryRunningInstanceResponseBody = {
  code?: string(name='Code', example='0'),
  data?: [ 
    {
      channel?: {
        appId?: string(name='AppId', example='ONEX7E28C7C221854'),
        channelId?: string(name='ChannelId', example='108293819'),
        expiredTime?: string(name='ExpiredTime', example='2022-01-04T16:00Z'),
        gslb?: [ string ](name='Gslb'),
        nonce?: string(name='Nonce', example='CK-9b5c335b9ae75879441ee7b363886418'),
        token?: string(name='Token', example='e59f61b2482b4d0562ab542da3f824f7'),
        type?: string(name='Type', example='6'),
        userId?: string(name='UserId', example='userId'),
        userInfoInChannel?: string(name='UserInfoInChannel'),
      }(name='Channel'),
      sessionId?: string(name='SessionId', example='4f63f9e9788449f9adc88d9438c8dec3'),
      token?: string(name='Token'),
      user?: {
        userId?: string(name='UserId', example='23423'),
        userName?: string(name='UserName'),
      }(name='User'),
    }
  ](name='Data'),
  message?: string(name='Message', example='operation success.'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='True'),
}

model QueryRunningInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryRunningInstanceResponseBody(name='body'),
}

async function queryRunningInstanceWithOptions(tmpReq: QueryRunningInstanceRequest, runtime: Util.RuntimeOptions): QueryRunningInstanceResponse {
  Util.validateModel(tmpReq);
  var request = new QueryRunningInstanceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appShrink)) {
    query['App'] = request.appShrink;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryRunningInstance',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryRunningInstance(request: QueryRunningInstanceRequest): QueryRunningInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryRunningInstanceWithOptions(request, runtime);
}

model QueryTimedResetOperateStatusRequest {
  instanceId?: string(name='InstanceId', example='avatar_operation_public_cn-7pp2****802'),
  tenantId?: long(name='TenantId', example='xxxxx'),
}

model QueryTimedResetOperateStatusResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    instanceId?: string(name='InstanceId', example='avatar_operation_public_cn-7pp2****802'),
    status?: long(name='Status', example='10'),
    statusStr?: string(name='StatusStr'),
    tenantId?: string(name='TenantId', example='xxxxx'),
  }(name='Data'),
  message?: string(name='Message', example='operation success.'),
  requestId?: string(name='RequestId', description='Id of the request', example='74d42913-f13c-47ac-a8ac-8610685688eb'),
  success?: boolean(name='Success', example='true'),
}

model QueryTimedResetOperateStatusResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryTimedResetOperateStatusResponseBody(name='body'),
}

async function queryTimedResetOperateStatusWithOptions(request: QueryTimedResetOperateStatusRequest, runtime: Util.RuntimeOptions): QueryTimedResetOperateStatusResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryTimedResetOperateStatus',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryTimedResetOperateStatus(request: QueryTimedResetOperateStatusRequest): QueryTimedResetOperateStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryTimedResetOperateStatusWithOptions(request, runtime);
}

model QueryVideoTaskInfoRequest {
  app?: {
    appId?: string(name='AppId', example='xxxxxxxxxx'),
  }(name='App'),
  orderById?: string(name='OrderById', example='desc'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  status?: int32(name='Status', example='3'),
  taskUuid?: string(name='TaskUuid', example='xxxx-xxxx-xxx'),
  tenantId?: long(name='TenantId', example='xxxxxx'),
  title?: string(name='Title'),
  type?: int32(name='Type', example='1'),
}

model QueryVideoTaskInfoShrinkRequest {
  appShrink?: string(name='App'),
  orderById?: string(name='OrderById', example='desc'),
  pageNo?: int32(name='PageNo', example='1'),
  pageSize?: int32(name='PageSize', example='10'),
  status?: int32(name='Status', example='3'),
  taskUuid?: string(name='TaskUuid', example='xxxx-xxxx-xxx'),
  tenantId?: long(name='TenantId', example='xxxxxx'),
  title?: string(name='Title'),
  type?: int32(name='Type', example='1'),
}

model QueryVideoTaskInfoResponseBody = {
  code?: string(name='Code', example='10010001'),
  data?: {
    list?: [ 
      {
        status?: int32(name='Status', example='3'),
        taskResult?: {
          alphaUrl?: string(name='AlphaUrl'),
          attachmentUrl?: string(name='AttachmentUrl'),
          failCode?: string(name='FailCode', example='10001001'),
          failReason?: string(name='FailReason'),
          previewPic?: string(name='PreviewPic'),
          subtitlesUrl?: string(name='SubtitlesUrl', example='xxx/xxx/xxx.ass'),
          videoDuration?: int32(name='VideoDuration', example='1111'),
          videoUrl?: string(name='VideoUrl', example='xxx/xxxx/xx.mp4'),
          wordSubtitlesUrl?: string(name='WordSubtitlesUrl', example='xxx/xxx/xxx.ass'),
        }(name='TaskResult'),
        taskUuid?: string(name='TaskUuid', example='789c45a5-2dca-4cd2-8fa7-f70a77e335ad'),
        title?: string(name='Title'),
        type?: int32(name='Type', example='1'),
      }
    ](name='List'),
    pageNo?: int32(name='PageNo', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    totalCount?: long(name='TotalCount', example='10'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='Id of the request', example='0A466686-8F3A-55A6-93D8-A0225DC965C0'),
  success?: boolean(name='Success', example='true'),
}

model QueryVideoTaskInfoResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: QueryVideoTaskInfoResponseBody(name='body'),
}

async function queryVideoTaskInfoWithOptions(tmpReq: QueryVideoTaskInfoRequest, runtime: Util.RuntimeOptions): QueryVideoTaskInfoResponse {
  Util.validateModel(tmpReq);
  var request = new QueryVideoTaskInfoShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appShrink)) {
    query['App'] = request.appShrink;
  }
  if (!Util.isUnset(request.orderById)) {
    query['OrderById'] = request.orderById;
  }
  if (!Util.isUnset(request.pageNo)) {
    query['PageNo'] = request.pageNo;
  }
  if (!Util.isUnset(request.pageSize)) {
    query['PageSize'] = request.pageSize;
  }
  if (!Util.isUnset(request.status)) {
    query['Status'] = request.status;
  }
  if (!Util.isUnset(request.taskUuid)) {
    query['TaskUuid'] = request.taskUuid;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  if (!Util.isUnset(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'QueryVideoTaskInfo',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function queryVideoTaskInfo(request: QueryVideoTaskInfoRequest): QueryVideoTaskInfoResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryVideoTaskInfoWithOptions(request, runtime);
}

model Render3dAvatarRequest {
  appId?: string(name='AppId', example='dsdsf1'),
  code?: string(name='Code', example='CH_2d_xxxxxx'),
  tenantId?: long(name='TenantId', example='9185'),
}

model Render3dAvatarResponseBody = {
  code?: string(name='Code', example='10010001'),
  data?: {
    renderData?: string(name='RenderData', example='{"xxxx":"xxxxxxxx"}'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4C8BF3A5-948F-1F89-AACD-D18DEF52D1XX'),
  success?: boolean(name='Success', example='true'),
}

model Render3dAvatarResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Render3dAvatarResponseBody(name='body'),
}

async function render3dAvatarWithOptions(request: Render3dAvatarRequest, runtime: Util.RuntimeOptions): Render3dAvatarResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.appId)) {
    query['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.code)) {
    query['Code'] = request.code;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Render3dAvatar',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function render3dAvatar(request: Render3dAvatarRequest): Render3dAvatarResponse {
  var runtime = new Util.RuntimeOptions{};
  return render3dAvatarWithOptions(request, runtime);
}

model SendCommandRequest {
  code?: string(name='Code', example='INTERRUPT'),
  content?: map[string]any(name='Content', example='{}'),
  feedback?: boolean(name='Feedback', example='false'),
  sessionId?: string(name='SessionId', example='5615'),
  tenantId?: long(name='TenantId', example='76898bd3b90b4a65b1c078d8824a2e9c'),
  uniqueCode?: string(name='UniqueCode', example='0000001000586737'),
}

model SendCommandShrinkRequest {
  code?: string(name='Code', example='INTERRUPT'),
  contentShrink?: string(name='Content', example='{}'),
  feedback?: boolean(name='Feedback', example='false'),
  sessionId?: string(name='SessionId', example='5615'),
  tenantId?: long(name='TenantId', example='76898bd3b90b4a65b1c078d8824a2e9c'),
  uniqueCode?: string(name='UniqueCode', example='0000001000586737'),
}

model SendCommandResponseBody = {
  code?: string(name='Code', example='10010001'),
  data?: {
    sessionId?: string(name='SessionId', example='9929391f61ef9e1c0000000000000006'),
    uniqueCode?: string(name='UniqueCode', example='0000001000586737'),
  }(name='Data'),
  message?: string(name='Message', example='operation success.'),
  requestId?: string(name='RequestId', description='Id of the request', example='0A466686-8F3A-55A6-93D8-A0225DC965C0'),
  success?: boolean(name='Success', example='true'),
}

model SendCommandResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendCommandResponseBody(name='body'),
}

async function sendCommandWithOptions(tmpReq: SendCommandRequest, runtime: Util.RuntimeOptions): SendCommandResponse {
  Util.validateModel(tmpReq);
  var request = new SendCommandShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.content)) {
    request.contentShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.content, 'Content', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.code)) {
    query['Code'] = request.code;
  }
  if (!Util.isUnset(request.contentShrink)) {
    query['Content'] = request.contentShrink;
  }
  if (!Util.isUnset(request.feedback)) {
    query['Feedback'] = request.feedback;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.uniqueCode)) {
    query['UniqueCode'] = request.uniqueCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendCommand',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sendCommand(request: SendCommandRequest): SendCommandResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendCommandWithOptions(request, runtime);
}

model SendMessageRequest {
  feedback?: boolean(name='Feedback', example='false'),
  sessionId?: string(name='SessionId', example='76898bd3b90b4a65b1c078d8824a2e9c'),
  streamExtension?: {
    index?: int32(name='Index'),
    isStream?: boolean(name='IsStream'),
    position?: string(name='Position'),
  }(name='StreamExtension'),
  tenantId?: long(name='TenantId', example='5615'),
  textRequest?: {
    commandType?: string(name='CommandType'),
    id?: string(name='Id', example='0000001000586737'),
    speechText?: string(name='SpeechText'),
    interrupt?: boolean(name='interrupt', example='false'),
  }(name='TextRequest'),
  VAMLRequest?: {
    code?: string(name='Code', example='VAML_REQUEST'),
    vaml?: string(name='Vaml'),
  }(name='VAMLRequest'),
}

model SendMessageShrinkRequest {
  feedback?: boolean(name='Feedback', example='false'),
  sessionId?: string(name='SessionId', example='76898bd3b90b4a65b1c078d8824a2e9c'),
  streamExtensionShrink?: string(name='StreamExtension'),
  tenantId?: long(name='TenantId', example='5615'),
  textRequestShrink?: string(name='TextRequest'),
  VAMLRequestShrink?: string(name='VAMLRequest'),
}

model SendMessageResponseBody = {
  code?: string(name='Code', description='Id of the request', example='QUERY_ACCOUNT_INFO_ERROR'),
  data?: {
    requestId?: string(name='RequestId', example='0A466686-8F3A-55A6-93D8-A0225DC965C0'),
    sessionId?: string(name='SessionId', example='9929391f61ef9e1c0000000000000006'),
  }(name='Data'),
  message?: string(name='Message', example='operation success.'),
  success?: boolean(name='Success', example='True'),
}

model SendMessageResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendMessageResponseBody(name='body'),
}

async function sendMessageWithOptions(tmpReq: SendMessageRequest, runtime: Util.RuntimeOptions): SendMessageResponse {
  Util.validateModel(tmpReq);
  var request = new SendMessageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.streamExtension)) {
    request.streamExtensionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.streamExtension, 'StreamExtension', 'json');
  }
  if (!Util.isUnset(tmpReq.textRequest)) {
    request.textRequestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.textRequest, 'TextRequest', 'json');
  }
  if (!Util.isUnset(tmpReq.VAMLRequest)) {
    request.VAMLRequestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.VAMLRequest, 'VAMLRequest', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.feedback)) {
    query['Feedback'] = request.feedback;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.streamExtensionShrink)) {
    query['StreamExtension'] = request.streamExtensionShrink;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.textRequestShrink)) {
    query['TextRequest'] = request.textRequestShrink;
  }
  if (!Util.isUnset(request.VAMLRequestShrink)) {
    query['VAMLRequest'] = request.VAMLRequestShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendMessage',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sendMessage(request: SendMessageRequest): SendMessageResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendMessageWithOptions(request, runtime);
}

model SendTextRequest {
  feedback?: boolean(name='Feedback', example='false'),
  interrupt?: boolean(name='Interrupt', example='true'),
  sessionId?: string(name='SessionId', example='5615'),
  streamExtension?: {
    index?: int32(name='Index', example='0'),
    isStream?: boolean(name='IsStream', example='true'),
    position?: string(name='Position', example='start'),
  }(name='StreamExtension'),
  tenantId?: long(name='TenantId', example='76898bd3b90b4a65b1c078d8824a2e9c'),
  text?: string(name='Text'),
  uniqueCode?: string(name='UniqueCode', example='0000001000586737'),
}

model SendTextShrinkRequest {
  feedback?: boolean(name='Feedback', example='false'),
  interrupt?: boolean(name='Interrupt', example='true'),
  sessionId?: string(name='SessionId', example='5615'),
  streamExtensionShrink?: string(name='StreamExtension'),
  tenantId?: long(name='TenantId', example='76898bd3b90b4a65b1c078d8824a2e9c'),
  text?: string(name='Text'),
  uniqueCode?: string(name='UniqueCode', example='0000001000586737'),
}

model SendTextResponseBody = {
  code?: string(name='Code', example='10010001'),
  data?: {
    sessionId?: string(name='SessionId', example='9929391f61ef9e1c0000000000000006'),
    uniqueCode?: string(name='UniqueCode', example='0000001000586737'),
  }(name='Data'),
  message?: string(name='Message', example='operation success.'),
  requestId?: string(name='RequestId', description='Id of the request', example='0A466686-8F3A-55A6-93D8-A0225DC965C0'),
  success?: boolean(name='Success', example='true'),
}

model SendTextResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendTextResponseBody(name='body'),
}

async function sendTextWithOptions(tmpReq: SendTextRequest, runtime: Util.RuntimeOptions): SendTextResponse {
  Util.validateModel(tmpReq);
  var request = new SendTextShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.streamExtension)) {
    request.streamExtensionShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.streamExtension, 'StreamExtension', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.feedback)) {
    query['Feedback'] = request.feedback;
  }
  if (!Util.isUnset(request.interrupt)) {
    query['Interrupt'] = request.interrupt;
  }
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.streamExtensionShrink)) {
    query['StreamExtension'] = request.streamExtensionShrink;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.text)) {
    query['Text'] = request.text;
  }
  if (!Util.isUnset(request.uniqueCode)) {
    query['UniqueCode'] = request.uniqueCode;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendText',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sendText(request: SendTextRequest): SendTextResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendTextWithOptions(request, runtime);
}

model SendVamlRequest {
  sessionId?: string(name='SessionId', example='76898bd3b90b4a65b1c078d8824a2e9c'),
  tenantId?: long(name='TenantId', example='5615'),
  vaml?: string(name='Vaml'),
}

model SendVamlResponseBody = {
  code?: string(name='Code', example='10010001'),
  data?: {
    sessionId?: string(name='SessionId', example='76898bd3b90b4a65b1c078d8824a2e9c'),
    uniqueCode?: string(name='UniqueCode', example='0000001000586737'),
  }(name='Data'),
  message?: string(name='Message', example='operation success.'),
  requestId?: string(name='RequestId', description='Id of the request', example='0A466686-8F3A-55A6-93D8-A0225DC965C0'),
  success?: boolean(name='Success', example='true'),
}

model SendVamlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SendVamlResponseBody(name='body'),
}

async function sendVamlWithOptions(request: SendVamlRequest, runtime: Util.RuntimeOptions): SendVamlResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.vaml)) {
    query['Vaml'] = request.vaml;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SendVaml',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sendVaml(request: SendVamlRequest): SendVamlResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendVamlWithOptions(request, runtime);
}

model StartInstanceRequest {
  app?: {
    appId?: string(name='AppId', example='ALIPUB5748B17121450'),
  }(name='App'),
  bizId?: string(name='BizId'),
  channel?: {
    reqConfig?: map[string]any(name='ReqConfig'),
    type?: string(name='Type', example='RTMP'),
  }(name='Channel'),
  commandRequest?: {
    alphaSwitch?: boolean(name='AlphaSwitch'),
    backGroundImageUrl?: string(name='BackGroundImageUrl'),
    locate?: int32(name='Locate'),
  }(name='CommandRequest'),
  tenantId?: long(name='TenantId', example='9185'),
  textRequest?: {
    pitchRate?: int32(name='PitchRate'),
    speechRate?: int32(name='SpeechRate'),
    voice?: string(name='Voice'),
    volume?: int32(name='Volume'),
  }(name='TextRequest'),
  user?: {
    userId?: string(name='UserId', example='23423'),
    userName?: string(name='UserName'),
  }(name='User'),
}

model StartInstanceShrinkRequest {
  appShrink?: string(name='App'),
  bizId?: string(name='BizId'),
  channelShrink?: string(name='Channel'),
  commandRequestShrink?: string(name='CommandRequest'),
  tenantId?: long(name='TenantId', example='9185'),
  textRequestShrink?: string(name='TextRequest'),
  userShrink?: string(name='User'),
}

model StartInstanceResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    channel?: {
      appId?: string(name='AppId', example='ONEX7E28C7C221854'),
      channelId?: string(name='ChannelId', example='108293819'),
      expiredTime?: string(name='ExpiredTime'),
      gslb?: [ string ](name='Gslb'),
      nonce?: string(name='Nonce', example='CK-9b5c335b9ae75879441ee7b363886418'),
      token?: string(name='Token', example='e59f61b2482b4d0562ab542da3f824f7'),
      type?: string(name='Type', example='6'),
      userId?: string(name='UserId', example='userId'),
      userInfoInChannel?: string(name='UserInfoInChannel'),
    }(name='Channel'),
    requestId?: string(name='RequestId'),
    sessionId?: string(name='SessionId', example='4f63f9e9788449f9adc88d9438c8dec3'),
    token?: string(name='Token', example='879441ee7b363886418'),
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success', example='True'),
}

model StartInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartInstanceResponseBody(name='body'),
}

async function startInstanceWithOptions(tmpReq: StartInstanceRequest, runtime: Util.RuntimeOptions): StartInstanceResponse {
  Util.validateModel(tmpReq);
  var request = new StartInstanceShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  if (!Util.isUnset(tmpReq.channel)) {
    request.channelShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.channel, 'Channel', 'json');
  }
  if (!Util.isUnset(tmpReq.commandRequest)) {
    request.commandRequestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.commandRequest, 'CommandRequest', 'json');
  }
  if (!Util.isUnset(tmpReq.textRequest)) {
    request.textRequestShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.textRequest, 'TextRequest', 'json');
  }
  if (!Util.isUnset(tmpReq.user)) {
    request.userShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.user, 'User', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appShrink)) {
    query['App'] = request.appShrink;
  }
  if (!Util.isUnset(request.bizId)) {
    query['BizId'] = request.bizId;
  }
  if (!Util.isUnset(request.channelShrink)) {
    query['Channel'] = request.channelShrink;
  }
  if (!Util.isUnset(request.commandRequestShrink)) {
    query['CommandRequest'] = request.commandRequestShrink;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.textRequestShrink)) {
    query['TextRequest'] = request.textRequestShrink;
  }
  if (!Util.isUnset(request.userShrink)) {
    query['User'] = request.userShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartInstance',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startInstance(request: StartInstanceRequest): StartInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return startInstanceWithOptions(request, runtime);
}

model StartTimedResetOperateRequest {
  instanceId?: string(name='InstanceId', example='avatar_operation_public_cn-7pp2****802'),
  tenantId?: long(name='TenantId', example='xxxxxx'),
}

model StartTimedResetOperateResponseBody = {
  code?: string(name='Code', example='0'),
  data?: {
    instanceId?: string(name='InstanceId'),
    tenantId?: long(name='TenantId', example='xxxxxx'),
  }(name='Data'),
  message?: string(name='Message', example='operation success.'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='true'),
}

model StartTimedResetOperateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StartTimedResetOperateResponseBody(name='body'),
}

async function startTimedResetOperateWithOptions(request: StartTimedResetOperateRequest, runtime: Util.RuntimeOptions): StartTimedResetOperateResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StartTimedResetOperate',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function startTimedResetOperate(request: StartTimedResetOperateRequest): StartTimedResetOperateResponse {
  var runtime = new Util.RuntimeOptions{};
  return startTimedResetOperateWithOptions(request, runtime);
}

model StopInstanceRequest {
  sessionId?: string(name='SessionId', example='9adb569b-f66b-4e92-8b9d-62aa626f8318'),
  tenantId?: long(name='TenantId', example='234234'),
}

model StopInstanceResponseBody = {
  code?: string(name='Code'),
  data?: {
    requestId?: string(name='RequestId'),
    sessionId?: string(name='SessionId', example='6296cc143d2c42899dae6eff19e8ac28'),
  }(name='Data'),
  message?: string(name='Message'),
  success?: boolean(name='Success', example='True'),
}

model StopInstanceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: StopInstanceResponseBody(name='body'),
}

async function stopInstanceWithOptions(request: StopInstanceRequest, runtime: Util.RuntimeOptions): StopInstanceResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.sessionId)) {
    query['SessionId'] = request.sessionId;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopInstance',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopInstance(request: StopInstanceRequest): StopInstanceResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopInstanceWithOptions(request, runtime);
}

model SubmitAudioTo2DAvatarVideoTaskRequest {
  app?: {
    appId?: string(name='AppId', example='3dt4sh3948'),
  }(name='App'),
  audioInfo?: {
    sampleRate?: int32(name='SampleRate'),
  }(name='AudioInfo'),
  avatarInfo?: {
    code?: string(name='Code', example='CH_2d_xxxxxxx'),
    height?: int32(name='Height'),
    width?: int32(name='Width'),
    x?: int32(name='X'),
    y?: int32(name='Y'),
  }(name='AvatarInfo'),
  callback?: boolean(name='Callback'),
  callbackParams?: string(name='CallbackParams'),
  extParams?: string(name='ExtParams'),
  tenantId?: long(name='TenantId', example='20516'),
  title?: string(name='Title'),
  url?: string(name='Url'),
  videoInfo?: {
    alphaFormat?: int32(name='AlphaFormat', example='1'),
    backgroundImageUrl?: string(name='BackgroundImageUrl'),
    isAlpha?: boolean(name='IsAlpha', example='false'),
    resolution?: int32(name='Resolution', example='3'),
  }(name='VideoInfo'),
}

model SubmitAudioTo2DAvatarVideoTaskShrinkRequest {
  appShrink?: string(name='App'),
  audioInfoShrink?: string(name='AudioInfo'),
  avatarInfoShrink?: string(name='AvatarInfo'),
  callback?: boolean(name='Callback'),
  callbackParams?: string(name='CallbackParams'),
  extParams?: string(name='ExtParams'),
  tenantId?: long(name='TenantId', example='20516'),
  title?: string(name='Title'),
  url?: string(name='Url'),
  videoInfoShrink?: string(name='VideoInfo'),
}

model SubmitAudioTo2DAvatarVideoTaskResponseBody = {
  code?: string(name='Code', example='10050008'),
  data?: {
    taskUuid?: string(name='TaskUuid', example='xxxx-xxx-xx-xx'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='4C8BF3A5-948F-1F89-AACD-D18DEF52D1XX'),
  success?: boolean(name='Success', example='true'),
}

model SubmitAudioTo2DAvatarVideoTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitAudioTo2DAvatarVideoTaskResponseBody(name='body'),
}

async function submitAudioTo2DAvatarVideoTaskWithOptions(tmpReq: SubmitAudioTo2DAvatarVideoTaskRequest, runtime: Util.RuntimeOptions): SubmitAudioTo2DAvatarVideoTaskResponse {
  Util.validateModel(tmpReq);
  var request = new SubmitAudioTo2DAvatarVideoTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  if (!Util.isUnset(tmpReq.audioInfo)) {
    request.audioInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.audioInfo, 'AudioInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.avatarInfo)) {
    request.avatarInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.avatarInfo, 'AvatarInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.videoInfo)) {
    request.videoInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.videoInfo, 'VideoInfo', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appShrink)) {
    query['App'] = request.appShrink;
  }
  if (!Util.isUnset(request.audioInfoShrink)) {
    query['AudioInfo'] = request.audioInfoShrink;
  }
  if (!Util.isUnset(request.avatarInfoShrink)) {
    query['AvatarInfo'] = request.avatarInfoShrink;
  }
  if (!Util.isUnset(request.callback)) {
    query['Callback'] = request.callback;
  }
  if (!Util.isUnset(request.callbackParams)) {
    query['CallbackParams'] = request.callbackParams;
  }
  if (!Util.isUnset(request.extParams)) {
    query['ExtParams'] = request.extParams;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  if (!Util.isUnset(request.url)) {
    query['Url'] = request.url;
  }
  if (!Util.isUnset(request.videoInfoShrink)) {
    query['VideoInfo'] = request.videoInfoShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitAudioTo2DAvatarVideoTask',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitAudioTo2DAvatarVideoTask(request: SubmitAudioTo2DAvatarVideoTaskRequest): SubmitAudioTo2DAvatarVideoTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitAudioTo2DAvatarVideoTaskWithOptions(request, runtime);
}

model SubmitAudioTo3DAvatarVideoTaskRequest {
  app?: {
    appId?: string(name='AppId', example='12131231'),
  }(name='App'),
  audioInfo?: {
    sampleRate?: int32(name='SampleRate'),
  }(name='AudioInfo'),
  avatarInfo?: {
    angle?: int32(name='Angle', example='0'),
    code?: string(name='Code', example='CH_xxxxxxx'),
    industryCode?: string(name='IndustryCode'),
    locate?: int32(name='Locate', example='0'),
  }(name='AvatarInfo'),
  callback?: boolean(name='Callback'),
  callbackParams?: string(name='CallbackParams'),
  extParams?: string(name='ExtParams'),
  tenantId?: long(name='TenantId', example='xxxx'),
  title?: string(name='Title'),
  url?: string(name='Url'),
  videoInfo?: {
    alphaFormat?: int32(name='AlphaFormat', example='1'),
    backgroundImageUrl?: string(name='BackgroundImageUrl'),
    isAlpha?: boolean(name='IsAlpha', example='false'),
    resolution?: int32(name='Resolution', example='1'),
  }(name='VideoInfo'),
}

model SubmitAudioTo3DAvatarVideoTaskShrinkRequest {
  appShrink?: string(name='App'),
  audioInfoShrink?: string(name='AudioInfo'),
  avatarInfoShrink?: string(name='AvatarInfo'),
  callback?: boolean(name='Callback'),
  callbackParams?: string(name='CallbackParams'),
  extParams?: string(name='ExtParams'),
  tenantId?: long(name='TenantId', example='xxxx'),
  title?: string(name='Title'),
  url?: string(name='Url'),
  videoInfoShrink?: string(name='VideoInfo'),
}

model SubmitAudioTo3DAvatarVideoTaskResponseBody = {
  code?: string(name='Code', example='10050008'),
  data?: {
    taskUuid?: string(name='TaskUuid', example='xxxx-xxx-xx-xx'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='true'),
}

model SubmitAudioTo3DAvatarVideoTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitAudioTo3DAvatarVideoTaskResponseBody(name='body'),
}

async function submitAudioTo3DAvatarVideoTaskWithOptions(tmpReq: SubmitAudioTo3DAvatarVideoTaskRequest, runtime: Util.RuntimeOptions): SubmitAudioTo3DAvatarVideoTaskResponse {
  Util.validateModel(tmpReq);
  var request = new SubmitAudioTo3DAvatarVideoTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  if (!Util.isUnset(tmpReq.audioInfo)) {
    request.audioInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.audioInfo, 'AudioInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.avatarInfo)) {
    request.avatarInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.avatarInfo, 'AvatarInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.videoInfo)) {
    request.videoInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.videoInfo, 'VideoInfo', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appShrink)) {
    query['App'] = request.appShrink;
  }
  if (!Util.isUnset(request.audioInfoShrink)) {
    query['AudioInfo'] = request.audioInfoShrink;
  }
  if (!Util.isUnset(request.avatarInfoShrink)) {
    query['AvatarInfo'] = request.avatarInfoShrink;
  }
  if (!Util.isUnset(request.callback)) {
    query['Callback'] = request.callback;
  }
  if (!Util.isUnset(request.callbackParams)) {
    query['CallbackParams'] = request.callbackParams;
  }
  if (!Util.isUnset(request.extParams)) {
    query['ExtParams'] = request.extParams;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  if (!Util.isUnset(request.url)) {
    query['Url'] = request.url;
  }
  if (!Util.isUnset(request.videoInfoShrink)) {
    query['VideoInfo'] = request.videoInfoShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitAudioTo3DAvatarVideoTask',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitAudioTo3DAvatarVideoTask(request: SubmitAudioTo3DAvatarVideoTaskRequest): SubmitAudioTo3DAvatarVideoTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitAudioTo3DAvatarVideoTaskWithOptions(request, runtime);
}

model SubmitAvatarVideoTaskRequest {
  app?: {
    appId?: string(name='AppId', example='3d95xx946a'),
  }(name='App'),
  callback?: boolean(name='Callback', example='false'),
  callbackParams?: string(name='CallbackParams', example='{
      "xxx": "xxx"
}'),
  extParams?: string(name='ExtParams', example='{
      "xxx": "xxx"
}'),
  tenantId?: long(name='TenantId', example='xxx'),
  title?: string(name='Title'),
  videoParams?: string(name='VideoParams'),
}

model SubmitAvatarVideoTaskShrinkRequest {
  appShrink?: string(name='App'),
  callback?: boolean(name='Callback', example='false'),
  callbackParams?: string(name='CallbackParams', example='{
      "xxx": "xxx"
}'),
  extParams?: string(name='ExtParams', example='{
      "xxx": "xxx"
}'),
  tenantId?: long(name='TenantId', example='xxx'),
  title?: string(name='Title'),
  videoParams?: string(name='VideoParams'),
}

model SubmitAvatarVideoTaskResponseBody = {
  code?: string(name='Code', example='10050008'),
  data?: {
    taskUuid?: string(name='TaskUuid', example='xxxxxx-xxxxx-xxxxx'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', description='Id of the request', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='true'),
}

model SubmitAvatarVideoTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitAvatarVideoTaskResponseBody(name='body'),
}

async function submitAvatarVideoTaskWithOptions(tmpReq: SubmitAvatarVideoTaskRequest, runtime: Util.RuntimeOptions): SubmitAvatarVideoTaskResponse {
  Util.validateModel(tmpReq);
  var request = new SubmitAvatarVideoTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appShrink)) {
    query['App'] = request.appShrink;
  }
  if (!Util.isUnset(request.callback)) {
    query['Callback'] = request.callback;
  }
  if (!Util.isUnset(request.callbackParams)) {
    query['CallbackParams'] = request.callbackParams;
  }
  if (!Util.isUnset(request.extParams)) {
    query['ExtParams'] = request.extParams;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  if (!Util.isUnset(request.videoParams)) {
    query['VideoParams'] = request.videoParams;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitAvatarVideoTask',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitAvatarVideoTask(request: SubmitAvatarVideoTaskRequest): SubmitAvatarVideoTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitAvatarVideoTaskWithOptions(request, runtime);
}

model SubmitTextTo2DAvatarVideoTaskRequest {
  app?: {
    appId?: string(name='AppId', example='12131231'),
  }(name='App'),
  audioInfo?: {
    pitchRate?: int32(name='PitchRate', example='0'),
    sampleRate?: int32(name='SampleRate'),
    speechRate?: int32(name='SpeechRate', example='0'),
    voice?: string(name='Voice', example='guijie'),
    volume?: int32(name='Volume', example='50'),
  }(name='AudioInfo'),
  avatarInfo?: {
    code?: string(name='Code', example='CH_xxxxx'),
    height?: int32(name='Height'),
    width?: int32(name='Width'),
    x?: int32(name='X'),
    y?: int32(name='Y'),
  }(name='AvatarInfo'),
  callback?: boolean(name='Callback'),
  callbackParams?: string(name='CallbackParams'),
  extParams?: string(name='ExtParams'),
  tenantId?: long(name='TenantId', example='xxxxx'),
  text?: string(name='Text'),
  title?: string(name='Title'),
  videoInfo?: {
    alphaFormat?: int32(name='AlphaFormat'),
    backgroundImageUrl?: string(name='BackgroundImageUrl'),
    isAlpha?: boolean(name='IsAlpha', example='false'),
    isSubtitles?: boolean(name='IsSubtitles', example='true', deprecated='true'),
    resolution?: int32(name='Resolution'),
    subtitleEmbedded?: boolean(name='SubtitleEmbedded'),
    subtitleStyle?: {
      color?: string(name='Color'),
      name?: string(name='Name'),
      outlineColor?: string(name='OutlineColor'),
      size?: int32(name='Size'),
      y?: int32(name='Y'),
    }(name='SubtitleStyle'),
  }(name='VideoInfo'),
}

model SubmitTextTo2DAvatarVideoTaskShrinkRequest {
  appShrink?: string(name='App'),
  audioInfoShrink?: string(name='AudioInfo'),
  avatarInfoShrink?: string(name='AvatarInfo'),
  callback?: boolean(name='Callback'),
  callbackParams?: string(name='CallbackParams'),
  extParams?: string(name='ExtParams'),
  tenantId?: long(name='TenantId', example='xxxxx'),
  text?: string(name='Text'),
  title?: string(name='Title'),
  videoInfoShrink?: string(name='VideoInfo'),
}

model SubmitTextTo2DAvatarVideoTaskResponseBody = {
  code?: string(name='Code'),
  data?: {
    taskUuid?: string(name='TaskUuid', example='xxxx-xxx-xxx'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success'),
}

model SubmitTextTo2DAvatarVideoTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitTextTo2DAvatarVideoTaskResponseBody(name='body'),
}

async function submitTextTo2DAvatarVideoTaskWithOptions(tmpReq: SubmitTextTo2DAvatarVideoTaskRequest, runtime: Util.RuntimeOptions): SubmitTextTo2DAvatarVideoTaskResponse {
  Util.validateModel(tmpReq);
  var request = new SubmitTextTo2DAvatarVideoTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  if (!Util.isUnset(tmpReq.audioInfo)) {
    request.audioInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.audioInfo, 'AudioInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.avatarInfo)) {
    request.avatarInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.avatarInfo, 'AvatarInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.videoInfo)) {
    request.videoInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.videoInfo, 'VideoInfo', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appShrink)) {
    query['App'] = request.appShrink;
  }
  if (!Util.isUnset(request.audioInfoShrink)) {
    query['AudioInfo'] = request.audioInfoShrink;
  }
  if (!Util.isUnset(request.avatarInfoShrink)) {
    query['AvatarInfo'] = request.avatarInfoShrink;
  }
  if (!Util.isUnset(request.callback)) {
    query['Callback'] = request.callback;
  }
  if (!Util.isUnset(request.callbackParams)) {
    query['CallbackParams'] = request.callbackParams;
  }
  if (!Util.isUnset(request.extParams)) {
    query['ExtParams'] = request.extParams;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.text)) {
    query['Text'] = request.text;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  if (!Util.isUnset(request.videoInfoShrink)) {
    query['VideoInfo'] = request.videoInfoShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitTextTo2DAvatarVideoTask',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitTextTo2DAvatarVideoTask(request: SubmitTextTo2DAvatarVideoTaskRequest): SubmitTextTo2DAvatarVideoTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitTextTo2DAvatarVideoTaskWithOptions(request, runtime);
}

model SubmitTextTo3DAvatarVideoTaskRequest {
  app?: {
    appId?: string(name='AppId', example='12131231'),
  }(name='App'),
  audioInfo?: {
    pitchRate?: int32(name='PitchRate'),
    sampleRate?: int32(name='SampleRate'),
    speechRate?: int32(name='SpeechRate'),
    voice?: string(name='Voice'),
    volume?: int32(name='Volume'),
  }(name='AudioInfo'),
  avatarInfo?: {
    angle?: int32(name='Angle', example='0'),
    code?: string(name='Code', example='CH_xxxxxxx'),
    industryCode?: string(name='IndustryCode'),
    locate?: int32(name='Locate', example='0'),
  }(name='AvatarInfo'),
  callback?: boolean(name='Callback'),
  callbackParams?: string(name='CallbackParams'),
  extParams?: string(name='ExtParams'),
  tenantId?: long(name='TenantId', example='xxxx'),
  text?: string(name='Text'),
  title?: string(name='Title'),
  videoInfo?: {
    alphaFormat?: int32(name='AlphaFormat', example='1'),
    backgroundImageUrl?: string(name='BackgroundImageUrl'),
    isAlpha?: boolean(name='IsAlpha', example='false'),
    isSubtitles?: boolean(name='IsSubtitles', example='true', deprecated='true'),
    resolution?: int32(name='Resolution', example='1'),
    subtitleEmbedded?: boolean(name='SubtitleEmbedded'),
    subtitleStyle?: {
      color?: string(name='Color'),
      name?: string(name='Name'),
      outlineColor?: string(name='OutlineColor'),
      size?: int32(name='Size'),
      y?: int32(name='Y'),
    }(name='SubtitleStyle'),
  }(name='VideoInfo'),
}

model SubmitTextTo3DAvatarVideoTaskShrinkRequest {
  appShrink?: string(name='App'),
  audioInfoShrink?: string(name='AudioInfo'),
  avatarInfoShrink?: string(name='AvatarInfo'),
  callback?: boolean(name='Callback'),
  callbackParams?: string(name='CallbackParams'),
  extParams?: string(name='ExtParams'),
  tenantId?: long(name='TenantId', example='xxxx'),
  text?: string(name='Text'),
  title?: string(name='Title'),
  videoInfoShrink?: string(name='VideoInfo'),
}

model SubmitTextTo3DAvatarVideoTaskResponseBody = {
  code?: string(name='Code', example='502'),
  data?: {
    taskUuid?: string(name='TaskUuid', example='xxxxxx-xxxxx-xxxxx'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='false'),
}

model SubmitTextTo3DAvatarVideoTaskResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SubmitTextTo3DAvatarVideoTaskResponseBody(name='body'),
}

async function submitTextTo3DAvatarVideoTaskWithOptions(tmpReq: SubmitTextTo3DAvatarVideoTaskRequest, runtime: Util.RuntimeOptions): SubmitTextTo3DAvatarVideoTaskResponse {
  Util.validateModel(tmpReq);
  var request = new SubmitTextTo3DAvatarVideoTaskShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.app)) {
    request.appShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.app, 'App', 'json');
  }
  if (!Util.isUnset(tmpReq.audioInfo)) {
    request.audioInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.audioInfo, 'AudioInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.avatarInfo)) {
    request.avatarInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.avatarInfo, 'AvatarInfo', 'json');
  }
  if (!Util.isUnset(tmpReq.videoInfo)) {
    request.videoInfoShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.videoInfo, 'VideoInfo', 'json');
  }
  var query = {};
  if (!Util.isUnset(request.appShrink)) {
    query['App'] = request.appShrink;
  }
  if (!Util.isUnset(request.audioInfoShrink)) {
    query['AudioInfo'] = request.audioInfoShrink;
  }
  if (!Util.isUnset(request.avatarInfoShrink)) {
    query['AvatarInfo'] = request.avatarInfoShrink;
  }
  if (!Util.isUnset(request.callback)) {
    query['Callback'] = request.callback;
  }
  if (!Util.isUnset(request.callbackParams)) {
    query['CallbackParams'] = request.callbackParams;
  }
  if (!Util.isUnset(request.extParams)) {
    query['ExtParams'] = request.extParams;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.text)) {
    query['Text'] = request.text;
  }
  if (!Util.isUnset(request.title)) {
    query['Title'] = request.title;
  }
  if (!Util.isUnset(request.videoInfoShrink)) {
    query['VideoInfo'] = request.videoInfoShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitTextTo3DAvatarVideoTask',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitTextTo3DAvatarVideoTask(request: SubmitTextTo3DAvatarVideoTaskRequest): SubmitTextTo3DAvatarVideoTaskResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitTextTo3DAvatarVideoTaskWithOptions(request, runtime);
}

model Update2dAvatarRequest {
  callback?: boolean(name='Callback', example='false'),
  code?: string(name='Code', example='CH_2d_xxxxxx'),
  description?: string(name='Description'),
  image?: string(name='Image', example='https://virtual-human-assets.oss-cn-beijing.aliyuncs.com/2d_assets/xxx/xxx/xxx.png?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx'),
  name?: string(name='Name'),
  orientation?: int32(name='Orientation', example='1'),
  portrait?: string(name='Portrait', example='https://virtual-human-assets.oss-cn-beijing.aliyuncs.com/2d_assets/xxx/xxx/xxx.png?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx'),
  tenantId?: long(name='TenantId', example='9185'),
  transparent?: boolean(name='Transparent', example='true'),
  video?: string(name='Video', example='https://virtual-human-assets.oss-cn-beijing.aliyuncs.com/2d_assets/xxx/xxx/xxx.mov?Expires=xxx&OSSAccessKeyId=xxx&Signature=xxx'),
}

model Update2dAvatarResponseBody = {
  code?: string(name='Code', example='10010001'),
  data?: {
    code?: string(name='Code', example='CH_2d_xxxxxx'),
  }(name='Data'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='13E0445E-CA7F-5DD3-9B0F-D4B39E0180F7'),
  success?: boolean(name='Success', example='false'),
}

model Update2dAvatarResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: Update2dAvatarResponseBody(name='body'),
}

async function update2dAvatarWithOptions(request: Update2dAvatarRequest, runtime: Util.RuntimeOptions): Update2dAvatarResponse {
  Util.validateModel(request);
  var query = {};
  if (!Util.isUnset(request.callback)) {
    query['Callback'] = request.callback;
  }
  if (!Util.isUnset(request.code)) {
    query['Code'] = request.code;
  }
  if (!Util.isUnset(request.description)) {
    query['Description'] = request.description;
  }
  if (!Util.isUnset(request.image)) {
    query['Image'] = request.image;
  }
  if (!Util.isUnset(request.name)) {
    query['Name'] = request.name;
  }
  if (!Util.isUnset(request.orientation)) {
    query['Orientation'] = request.orientation;
  }
  if (!Util.isUnset(request.portrait)) {
    query['Portrait'] = request.portrait;
  }
  if (!Util.isUnset(request.tenantId)) {
    query['TenantId'] = request.tenantId;
  }
  if (!Util.isUnset(request.transparent)) {
    query['Transparent'] = request.transparent;
  }
  if (!Util.isUnset(request.video)) {
    query['Video'] = request.video;
  }
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'Update2dAvatar',
    version = '2022-01-30',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function update2dAvatar(request: Update2dAvatarRequest): Update2dAvatarResponse {
  var runtime = new Util.RuntimeOptions{};
  return update2dAvatarWithOptions(request, runtime);
}

